set(HSAILASM $<TARGET_FILE:HSAILasm>)
if (MSVC)
  set(RUNTEST ${CMAKE_CURRENT_SOURCE_DIR}/run_test.cmd)
else()
  set(RUNTEST ${CMAKE_CURRENT_SOURCE_DIR}/run_test)
endif()

macro(instruction_test name)
  add_test(NAME 1.0/instruction/${name}
           COMMAND ${RUNTEST} ${HSAILASM} ${name} ${CMAKE_CURRENT_SOURCE_DIR}
           WORKING_DIRECTORY ${CMAKE_CURRENT_BINARY_DIR})
endmacro()

instruction_test(CORE-base-large)
instruction_test(CORE-base-small)
instruction_test(CORE-full-large)
instruction_test(CORE-full-small)
instruction_test(IMAGE-base-large)
instruction_test(IMAGE-base-small)
instruction_test(IMAGE-full-large)
instruction_test(IMAGE-full-small)
if(AMD_EXTENSIONS)
instruction_test(amd_gcn-base-large)
instruction_test(amd_gcn-base-small)
instruction_test(amd_gcn-full-large)
instruction_test(amd_gcn-full-small)
instruction_test(amd_mipmap-base-large)
instruction_test(amd_mipmap-base-small)
instruction_test(amd_mipmap-full-large)
instruction_test(amd_mipmap-full-small)
endif()
